<template>
    <div>
        <div class="title">{{ name }}的动态</div>
    </div>
</template>

<script>
import { mapState, mapActions } from 'vuex';
export default {
    computed: {
        ...mapState(['userid']),
    },
    mounted() {
        this.name = localStorage.getItem('nickname')
        if (this.userid !== null) {
            this.uid = this.userid.userid
            this.getData()
        }
    },
    watch: {
        userid(newVal, oldVal) {
            this.uid = newVal.userid
            this.getData()
        },
    },
    data() {
        return {
            name: '',
            uid: '',
            data: null
        }
    },
    methods: {
        getData() {
            // userEvent
            this.$api.userEvent({ uid: this.uid }).then((ret) => {
                console.log(ret)
            })
        }
    },
}
</script>

<style scoped>
</style>